<?php

namespace app\controller;

use core\Controller;

class Home extends Controller
{
    public function _before()
    {
        // dd($this->segment(3));
        echo 'before';
    }

    // #[Get: '/']
    public function index(): void
    {
        $this->user = $this->db->fetch("SELECT id, username FROM users");

        $this->render('home/index');
    }

    public function demo()
    {
        $a = [
            'b' => '<b>bb</b>',
            'c' => 'ccc',
        ];

        $this->display('home/demo', ['a' => $a]);
    }
}
